﻿<!DOCTYPE html>
<html>
<head>
    <title>CGI</title>
</head>
<body>
    <h1>Our Page</h1>
    <!--01-->
    <script>
        var orderId = 9001;
        var orderId1 = "ORD - 9001";
        console.log(orderId);
        console.log(orderId1);
    </script>
    <!--02-- In JS, variables are dynamically typed-->
    <!--<script>
        var orderId = "ORD-9001";
        orderId = 1201;
        console.log(orderId);
    </script>-->
    <!--03-->
    <!--<script>
        var orderId;
        console.log(orderId);
    </script>-->
    <!--04 JS create new global variable, shouldn't-->
    <!--<script>
        orderId = 9001;
        console.log(orderId);
    </script>-->
    <!--05 Runtime Error: variable undefined in strict mode, handle bug-->
    <!--<script>
        'use strict';
        orderId = 9001;
        console.log(orderId);
    </script>-->
    <!--06-->
    <!--<script>
        var orderId = 9001;
        var orderId1 = 9001.01;
        var orderId2 = "ORD-9001";
        var isActive = true;
        console.log(typeof orderId1);
        console.log(typeof orderId2);
        console.log(typeof orderId3);
        console.log(typeof isActive);
    </script>-->
    <!--07-->
    <!--<script>
        var isActive;
        console.log(typeof isActive);
    </script>-->
    <!--08 object (primitive & complex data type)-->
    <!--<script>
        var order = {
            orderId: 9001,
            isActive: true
        };
        console.log(typeof order);
    </script>-->
    <!--09-->
    <!--<script>
        var order = {
            orderId: 9001,
            isActive: true
        };
        var cancelledOrders = [9001, 9002, 9003];
        console.log(typeof order);
        console.log(typeof cancelledOrders);
    </script>-->
    <!--10 type of order is object, but it's empty,no field or properties-->
    <!--<script>
        var order = null;
        console.log(typeof order);
    </script>-->
    <!--11-->
    <!--<script>
        function cancelOrder(orderId) {
        };
        console.log(typeof cancelOrder);
    </script>-->
</body>
</html>